package com.flymobi.service;

import java.util.List;

import com.flymobi.fw.modules.CommonService;
import com.flymobi.po.SysPower;
import com.flymobi.util.QL;

public class SysPowerService extends CommonService {
	public List<SysPower> list(String rolesId) {
		return dao.find(SysPower.class, QL.HQL.SysPower.LIST, new Object[] {new Long(rolesId)});
	}

	public void save(SysPower sysPower) {
		dao.save(sysPower);
	}

	public SysPower get(String id) {
		return dao.get(SysPower.class, new Long(id));
	}
	
	public SysPower load(String id) {
		return dao.load(SysPower.class, new Long(id));
	}

	public void delete(String id) {
		dao.delete(this.get(id));
	}

	public void deleteByMenuId(String menuId) {
		dao.executeByHQL(QL.HQL.SysPower.DELETE_BY_MENUID, new Object[]{new Long(menuId)});
	}
	
	public void deleteByRolesId(String rolesId) {
		dao.executeByHQL(QL.HQL.SysPower.DELETE_BY_RolesID, new Object[]{new Long(rolesId)});
	}
}
